package com.rest.demo.util;

import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.Date;

public class TimeDate {


    public String NowTime() {

        SimpleDateFormat formatter= new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
        Date date = new Date(System.currentTimeMillis());
        System.out.println(formatter.format(date));



            LocalDate today = LocalDate.now();
            System.out.println("今天的时间是 : " + today);
            int year = today.getYear();
            int month = today.getMonthValue();
            int day = today.getDayOfMonth();

            System.out.println("Today's Local date : " + today);
            System.out.printf("Year : %d; Month : %d; day : %d%n", year, month, day);
            return formatter.format(date).toString();

    }
}
